package com.battle.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.battle.pojo.converter.StringListConverter;
import jakarta.persistence.Column;
import jakarta.persistence.Convert;
import jakarta.persistence.Entity;
import lombok.Data;
import nirvana.core.domains.ann.AccEntity;
import nirvana.core.domains.entity.DomainBaseEntity;
import nirvana.core.domains.enums.EntityType;

import java.util.List;

/**
 * @author anni.zhu
 * @author anni.zhu@king-v.com
 * Created in 2024/8/22 14:33
 * 战例研讨记录
 */

@Data
@TableName(value = "WAR_CASE_STUDY_DETAILS",autoResultMap = true)
@Entity(name = "WAR_CASE_STUDY_DETAILS")
@AccEntity(value = "战例研讨记录", type = EntityType.SERVICE_ENTITY)
public class WarCaseStudyDetails extends DomainBaseEntity<WarCaseStudyDetails> {
    /**
     * 研讨id
     */
    @Column(nullable = false)
    private Long studyId;

    /**
     * 用户id
     */
    @Column(nullable = false)
    private Long userId;

    /**
     * 研讨内容
     */
    @Column(length = 255)
    private String content;

    /**
     * 研讨内容照片
     */
    @Column(columnDefinition="varchar(500)")
    @Convert(converter = StringListConverter.class)
    @TableField(value = "content_picture",typeHandler = JacksonTypeHandler.class)
    private List<String> contentPicture;

    /**
     * 是否是回复
     */
    @Column()
    private Boolean isReply;

    /**
     * 战例研讨记录id--针对回复
     */
    @Column()
    private Long detailsId;

    /**
     * 是否置顶
     */
    @Column()
    private Boolean isTop;

    /**
     * 点赞数量
     */
    @Column()
    private Integer upvoteNumber;
}
